/**************************************************************************************
*  FileOutputStream.c
*
*  This file defines all native methods that have to be implemented to support
*  java/lang/FileOutputStream class.
*  Actual implementation is target device dependent and therefore must be
*  implemented by the application developer.
*
*  Application developer should use the following functions to get access to
*  arrays and String object:
*       vmGetStringCount
*       vmGetStringArray
*       vmGetArraySize
*       vmGetArray
*  These functions are accessible via vm_config_t structure (see Win32 demo
*  application for examples on how to use them).
*
**************************************************************************************
*
* This file is covered by the GNU GPL with the following exception:
*   As a special exception, the copyright holders of this library give you permission
*   to link this library with independent modules to produce an executable, regardless
*   of the license terms of these independent modules, and to copy and distribute the
*   resulting executable under terms of your choice, provided that you also meet, for
*   each linked independent module, the terms and conditions of the license of that
*   module. An independent module is a module which is not derived from or based on
*   this library. If you modify this library, you may extend this exception to your
*   version of the library, but you are not obligated to do so. If you do not wish
*   to do so, delete this exception statement from your version.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY,  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL RTJ COMPUTING BE LIABLE FOR ANY CLAIM, DAMAGES
* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Copyright (c) 2000-2002 RTJ Computing Pty. Ltd. All rights reserved.
**************************************************************************************/
#include "javavm.h"

/****************************************************************************
* Closes the opened file handle.
* On entry param[1] will contain native file handle.
* On return function should indicate if handle was closed via retval parameter:
*       0   - handle closed successfully
*       -1  - closing has failed
*
* Java prototype:
*           private native int close0(int handle);
*
****************************************************************************/
int16 java_io_FileOutputStream_close0(int32 param[], int32 *retval)
{
    /* Add your code here */

    return NO_EXCEP;
}


/****************************************************************************
* Opens the named file.
* On entry param[1] will contain reference to String containg the name of a file.
*          param[2] will contain flag indicating whether to open for appending
* On return function should provide file handle via retval parameter:
*       >= 0    - file handle
*       -1      - opening has failed
*
* Java prototype:
*           private native int open0(String name, boolean append);
*
****************************************************************************/
int16 java_io_FileOutputStream_open0(int32 param[], int32 *retval)
{
    /* Add your code here */

    return NO_EXCEP;
}


/****************************************************************************
* Writes the data to the file.
* On entry param[1] will contain native file handle.
*          param[2] will contain reference to source byte array
*          param[3] will contain offset to source array
*          param[4] will contain number of bytes to write (copy from source array)
* On return function should indicate whether write was successful via retval parameter:
*       0   - write successful
*       -1  - writing has failed
*
* Java prototype:
*           private native int write0(int handle, byte[] buf, int offset, int len);
*
****************************************************************************/
int16 java_io_FileOutputStream_write0(int32 param[], int32 *retval)
{
    /* Add your code here */

    return NO_EXCEP;
}

